/*
 * 文件名：BaseSelectOptionSearchService.java
 * 版权：Copyright 2018-2019 Love. Co. Ltd. All Rights Reserved.
 * 描述：Anthony.CHONG
 * 修改人：Anthony.CHONG
 * 修改时间：2020年03月23日
 * 系统名称：xiaole
 */
package com.sinbader.xiaole.common.service.impl;

import cn.stylefeng.guns.sys.core.util.UserKit;
import com.sinbader.xiaole.common.mapper.BaseSelectOptionSearchMapper;
import com.sinbader.xiaole.common.model.xiaolevo.SelectOptionDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/**
 * <一句话功能简述>
 * <功能详细描述>
 *
 * @author CHONG
 * @version 1.0 2020年03月23日
 * @see BaseSelectOptionSearchService
 * @since 1.0
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class BaseSelectOptionSearchService {
    /**
     * baseSelectOptionSearchMapper - 下拉框查询
     */
    @Autowired
    BaseSelectOptionSearchMapper baseSelectOptionSearchMapper;

    /**
     * 初始化 - 仓库下拉框
     *
     * @param parameterMap
     * @return
     */
    public List<SelectOptionDto> getSelectOptionsForWarehouse(Map<String, Object> parameterMap) {
        //只有门店才会操作仓库
        parameterMap.put("shopId",UserKit.getOrgId());
        return baseSelectOptionSearchMapper.getSelectOptionsForWarehouse(parameterMap);
    }

    /**
     * 初始化 - 商品信息下拉框
     *
     * @param parameterMap
     * @return
     */
    public List<SelectOptionDto> getProductList(Map<String, Object> parameterMap) {
        return baseSelectOptionSearchMapper.getProductList(parameterMap);
    }


    /**
     * 初始化 - 供应商下拉框
     *
     * @param parameterMap
     * @return
     */
    public List<SelectOptionDto> getSelectOptionsSupplier(Map<String, Object> parameterMap) {
        return baseSelectOptionSearchMapper.getSelectOptionsSupplier(parameterMap);
    }
    /**
     * 初始化 - 厂家和门店信息
     *
     * @param parameterMap
     * @return
     */
    public List<SelectOptionDto> getFactoryAndShopList(Map<String, Object> parameterMap) {
        return baseSelectOptionSearchMapper.getFactoryAndShopList(parameterMap);
    }

    /**
     * 初始化 - 门店下拉框
     *
     * @param parameterMap
     * @return
     */
    public List<SelectOptionDto> getShopList(Map<String, Object> parameterMap) {
        return baseSelectOptionSearchMapper.getShopList(parameterMap);
    }

    /**
     * 初始化 - 商品分类下拉框
     *
     * @param parameterMap
     * @return
     */
    public List<SelectOptionDto> getProductCategory(Map<String, Object> parameterMap) {
        return baseSelectOptionSearchMapper.getProductCategory(parameterMap);
    }

    /**
     * 初始化 - 货架下拉框
     * @param parameterMap
     * @return
     */
    public List<SelectOptionDto> initShelfSelectOptions(Map<String, Object> parameterMap) {
        return baseSelectOptionSearchMapper.getShelfSelectOptions(parameterMap);
    }
}